home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Overview / OOPTESample / TESample.r < prev    next >
Encoding:
Text File  |  1994-11-18  |  6.1 KB  |  274 lines  |  [TEXT/MPS ]

  1. /*---------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple TextEdit Sample Application
  6. #
  7. #    OOPTESample
  8. #
  9. #    TESample.r        -    Resource Source
  10. #
  11. #    Copyright © 1988, 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:        
  15. #                    1.00                    04/89
  16. #                    1.10                    02/90
  17. #                    1.11                    10/92
  18. #
  19. #    Components:     
  20. #                    BuildOOPTESample            February 1, 1990
  21. #                    MTESample.p                    February 1, 1990
  22. #                    OOPTESample.make            February 1, 1990
  23. #                    TECommon.h                    February 1, 1990
  24. #                    TESampleGlue.a                February 1, 1990
  25. #                    TESample.r                    February 1, 1990
  26. #                    TMLRules.make                February 1, 1990
  27. #                    UApplication.p                February 1, 1990
  28. #                    UApplication.inc1.p            February 1, 1990
  29. #                    UDocument.p                    February 1, 1990
  30. #                    UDocument.inc1.p            February 1, 1990
  31. #                    UTEDocument.p                February 1, 1990
  32. #                    UTEDocument.inc1.p            February 1, 1990
  33. #                    UTESample.p                    February 1, 1990
  34. #                    UTESample.inc1.p            February 1, 1990
  35. #
  36. ---------------------------------------------------------------------*/
  37.  
  38. #include "SysTypes.r"
  39. #include "Types.r"
  40.  
  41. #include "TECommon.h"
  42.  
  43. resource 'vers' (1) {
  44.     0x01, 0x10, release, 0x00,
  45.     verUS,
  46.     "1.10",
  47.     "1.10, Copyright © 1988 Apple Computer, Inc."
  48. };
  49.  
  50. /* we use an MBAR resource to conveniently load all the menus */
  51.  
  52. resource 'MBAR' (rMenuBar, preload) {
  53.     { mApple, mFile, mEdit };        /* three menus */
  54. };
  55.  
  56.  
  57. resource 'MENU' (mApple, preload) {
  58.     mApple, textMenuProc,
  59.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  60.     enabled, apple,
  61.     {
  62.         "About OOPTESample…",
  63.             noicon, nokey, nomark, plain;
  64.         "-",
  65.             noicon, nokey, nomark, plain
  66.     }
  67. };
  68.  
  69. resource 'MENU' (mFile, preload) {
  70.     mFile, textMenuProc,
  71.     0b0000000000000000000100000000000,    /* enable Quit only, program enables others */
  72.     enabled, "File",
  73.     {
  74.         "New",
  75.             noicon, "N", nomark, plain;
  76.         "Open",
  77.             noicon, "O", nomark, plain;
  78.         "-",
  79.             noicon, nokey, nomark, plain;
  80.         "Close",
  81.             noicon, "W", nomark, plain;
  82.         "Save",
  83.             noicon, "S", nomark, plain;
  84.         "Save As…",
  85.             noicon, nokey, nomark, plain;
  86.         "Revert",
  87.             noicon, nokey, nomark, plain;
  88.         "-",
  89.             noicon, nokey, nomark, plain;
  90.         "Page Setup…",
  91.             noicon, nokey, nomark, plain;
  92.         "Print…",
  93.             noicon, nokey, nomark, plain;
  94.         "-",
  95.             noicon, nokey, nomark, plain;
  96.         "Quit",
  97.             noicon, "Q", nomark, plain
  98.     }
  99. };
  100.  
  101. resource 'MENU' (mEdit, preload) {
  102.     mEdit, textMenuProc,
  103.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  104.     enabled, "Edit",
  105.      {
  106.         "Undo",
  107.             noicon, "Z", nomark, plain;
  108.         "-",
  109.             noicon, nokey, nomark, plain;
  110.         "Cut",
  111.             noicon, "X", nomark, plain;
  112.         "Copy",
  113.             noicon, "C", nomark, plain;
  114.         "Paste",
  115.             noicon, "V", nomark, plain;
  116.         "Clear",
  117.             noicon, nokey, nomark, plain
  118.     }
  119. };
  120.  
  121.  
  122. /* this ALRT and DITL are used as an About screen */
  123.  
  124. resource 'ALRT' (rAboutAlert, purgeable) {
  125.     {40, 20, 160, 330 }, rAboutAlert, {
  126.         OK, visible, silent;
  127.         OK, visible, silent;
  128.         OK, visible, silent;
  129.         OK, visible, silent
  130.     };
  131. };
  132.  
  133. resource 'DITL' (rAboutAlert, purgeable) {
  134.     { /* array DITLarray: 5 elements */
  135.         /* [1] */
  136.         {88, 224, 108, 304},
  137.         Button {
  138.             enabled,
  139.             "OK"
  140.         },
  141.         /* [2] */
  142.         {8, 8, 24, 304 },
  143.         StaticText {
  144.             disabled,
  145.             "MultiFinder-Aware Object Pascal Application"
  146.         },
  147.         /* [3] */
  148.         {32, 8, 48, 237},
  149.         StaticText {
  150.             disabled,
  151.             "Copyright © 1988 Apple Computer"
  152.         },
  153.         /* [4] */
  154.         {56, 8, 72, 136},
  155.         StaticText {
  156.             disabled,
  157.             "Brought to you by:"
  158.         },
  159.         /* [5] */
  160.         {80, 24, 112, 167},
  161.         StaticText {
  162.             disabled,
  163.             "Macintosh Developer  Technical Support"
  164.         }
  165.     }
  166. };
  167.  
  168.  
  169. resource 'WIND' (rDocWindow, preload, purgeable) {
  170.     {64, 60, 314, 460},
  171.     zoomDocProc, invisible, goAway, 0x0, "untitled"
  172. };
  173.  
  174.  
  175. resource 'CNTL' (rVScroll, preload, purgeable) {
  176.     {-1, 385, 236, 401},
  177.     0, visible, 0, 0, scrollBarProc, 0, ""
  178. };
  179.  
  180.  
  181. resource 'CNTL' (rHScroll, preload, purgeable) {
  182.     {235, -1, 251, 386},
  183.     0, visible, 0, 0, scrollBarProc, 0, ""
  184. };
  185.  
  186. resource 'STR#' (kTEDocErrStrings, purgeable) {
  187.     {
  188.     "Not enough memory to run TESample";
  189.     "Not enough memory to do Cut";
  190.     "Cannot do Cut";
  191.     "Cannot do Copy";
  192.     "Cannot exceed 32,000 characters with Paste";
  193.     "Not enough memory to do Paste";
  194.     "Cannot create window";
  195.     "Cannot exceed 32,000 characters";
  196.     "Cannot do Paste"
  197.     }
  198. };
  199.  
  200. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  201.  
  202. resource 'SIZE' (-1) {
  203.     dontSaveScreen,
  204.     acceptSuspendResumeEvents,
  205.     enableOptionSwitch,
  206.     canBackground,        /* we can background; we don't currently, but our sleep value */
  207.                         /* guarantees we don't hog the Mac while we are in the background */
  208.     multiFinderAware,    /* this says we do our own activate/deactivate; don't fake us out */
  209.     backgroundAndForeground, /* this is definitely note a background-only application! */
  210.     dontGetFrontClicks,    /* change this is if you want "do first click" behavior like the Finder */
  211.     ignoreChildDiedEvents,
  212.     is32BitCompatible,
  213.     reserved, reserved, reserved, reserved,
  214.     reserved, reserved, reserved,
  215.     kPrefSize * 1024,
  216.     kMinSize * 1024
  217. };
  218.  
  219.  
  220. type 'MOOT' as 'STR ';
  221.  
  222.  
  223. resource 'MOOT' (0) {
  224.     "MultiFinder-Aware TextEdit Sample Application"
  225. };
  226.  
  227.  
  228. resource 'BNDL' (128) {
  229.     'MOOT',
  230.     0,
  231.     {
  232.         'ICN#',
  233.         {
  234.             0, 128
  235.         },
  236.         'FREF',
  237.         {
  238.             0, 128
  239.         }
  240.     }
  241. };
  242.  
  243.  
  244. resource 'FREF' (128) {
  245.     'APPL',
  246.     0,
  247.     ""
  248. };
  249.  
  250.  
  251. resource 'ICN#' (128) {
  252.     { /* array: 2 elements */
  253.         /* [1] */
  254.         $"04 30 40 00 0A 50 A0 00 0B 91 10 02 08 22 08 03"
  255.         $"12 24 04 05 20 28 02 09 40 10 01 11 80 0C 00 A1"
  256.         $"80 03 FF C2 7E 00 FF 04 01 00 7F 04 03 00 1E 08"
  257.         $"04 E0 00 0C 08 E0 00 0A 10 E0 00 09 08 C0 00 06"
  258.         $"04 87 FE 04 02 88 01 04 01 88 00 84 00 88 00 44"
  259.         $"00 88 00 44 00 88 00 C4 01 10 01 88 02 28 03 10"
  260.         $"01 C4 04 E0 00 02 08 00 73 BF FB EE 4C A2 8A 2A"
  261.         $"40 AA AA EA 52 AA AA 24 5E A2 8A EA 73 BE FB 8E",
  262.         /* [2] */
  263.         $"04 30 40 00 0E 70 E0 00 0F F1 F0 02 0F E3 F8 03"
  264.         $"1F E7 FC 07 3F EF FE 0F 7F FF FF 1F FF FF FF BF"
  265.         $"FF FF FF FE 7F FF FF FC 01 FF FF FC 03 FF FF F8"
  266.         $"07 FF FF FC 0F FF FF FE 1F FF FF FF 0F FF FF FE"
  267.         $"07 FF FF FC 03 FF FF FC 01 FF FF FC 00 FF FF FC"
  268.         $"00 FF FF FC 00 FF FF FC 01 FF FF F8 03 EF FF F0"
  269.         $"01 C7 FC E0 00 03 F8 00 73 BF FB EE 7F BE FB EE"
  270.         $"7F BE FB EE 7F BE FB E4 7F BE FB EE 73 BE FB 8E"
  271.     }
  272. };
  273.  
  274.